package com.zengruoxing.helloworldtest;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onClick(View view) {
//        Toast.makeText(this, "响应按钮事件",
//                Toast.LENGTH_LONG).show();
        TextView input = (TextView) findViewById(R.id.textView);
        String string = input.getText().toString() + " changed by xxx";
        Toast.makeText(this, string, Toast.LENGTH_LONG).show();
//        test set textview message
//        TextView textView = (TextView) findViewById(R.id.textView);
        EditText input1 = (EditText) findViewById(R.id.editText);
        String str = input1.getText().toString();
        input.setText(str);
    }
}